using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableShoppingType
	{
		public const string Table = "ShoppingType";
		public const string ShoppingTypeID = "ShoppingTypeID";
		public const string ShoppingTypeName = "ShoppingTypeName";
	}
	
	[Serializable]
	public class BaseShoppingType
		: IDbSessionEntity, IJsonClass
	{
		int m_ShoppingTypeID;
		/// <summary>
        /// 
        /// </summary>
        public int ShoppingTypeID
        {
            get { return m_ShoppingTypeID; }
            set { m_ShoppingTypeID = value; }
        }
		
		string m_ShoppingTypeName;
		/// <summary>
        /// 
        /// </summary>
        public string ShoppingTypeName
        {
            get { return m_ShoppingTypeName; }
            set { m_ShoppingTypeName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ShoppingTypeID = reader[TableShoppingType.ShoppingTypeID];
            m_ShoppingTypeName = reader[TableShoppingType.ShoppingTypeName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableShoppingType.ShoppingTypeID, PrimaryKeyType.Identity, ShoppingTypeID);
			writer[TableShoppingType.ShoppingTypeName] = ShoppingTypeName;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ShoppingTypeID = idd;
        }
		
		public string TableName
        {
            get { return TableShoppingType.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ShoppingTypeID = hashToRead["ShoppingTypeID"];
			 
             m_ShoppingTypeName = hashToRead["ShoppingTypeName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ShoppingTypeID"] = ShoppingTypeID;
			 
            hashToFill["ShoppingTypeName"] = ShoppingTypeName;
			 
        }

        #endregion
		
	}
}
